home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 April / macformat-049.iso / mac / Shareware Plus / Developers / dropg++ / usr / src / examples / stat.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-31  |  311 b   |  13 lines  |  [TEXT/R*ch]

  1. #include <stdio.h>
  2. #include <sys/stat.h>
  3.  
  4. main(int argc, char **argv)
  5.         {
  6.         char name[99];
  7.         struct stat statbuf;
  8.         strcpy(name, argv[argc-1]);
  9.         if (stat(name, &statbuf)) perror(name),exit(-2);
  10.         printf("File size = %d bytes\n", statbuf.st_size);
  11.         exit(0);
  12.         }
  13.